<template>
  <div id="app">
    <router-view />
  </div>
</template>
<script>
// import { getDomainInfo } from "@/api/member/index";
import { os } from "./utils/common.js";
export default {
  components: {},
  computed: {},
  data() {
    return {
      isPrivate: process.env.NODE_ENV == 'private',
    }
  },
  beforeCreate() {
    // // 调接口 查看当前域名是否有用
    // let domain = window.location.hostname;
    // getDomainInfo({ domain: domain }).then((res) => {
    //   if (!res.data && domain != 'dangan.qcdoc.cn') {
    //     // 跳转到dangan.qcdoc.cn
    //     // window.open('https://dangan.qcdoc.cn', '_self')
    //   }
    // });
  },
  mounted() {
    this.isMobile();
    if (!this.isMobile() && !this.isPrivate) {
      (function (a, h, c, b, f, g) {
        a["UdeskApiObject"] = f;
        a[f] =
          a[f] ||
          function () {
            (a[f].d = a[f].d || []).push(arguments);
          };
        g = h.createElement(c);
        g.async = 1;
        g.charset = "utf-8";
        g.src = b;
        c = h.getElementsByTagName(c)[0];
        c.parentNode.insertBefore(g, c);
      })(
        window,
        document,
        "script",
        "https://assets-cli.s2.udesk.cn/im_client/js/udeskApi.js",
        "ud"
      );
      ud({
        code: "abkdj25",
        link: "https://qiaochu.s2.udesk.cn/im_client/?web_plugin_id=9667",
      });
    }
  },
  methods: {
    isMobile() {
      if (os.isAndroid || os.isPhone) {
        this.$store.commit("app/SET_IS_MOBILE", true);
        return true;
      } else {
        this.$store.commit("app/SET_IS_MOBILE", false);
        return false;
      }
    },
  },
};
</script>
<style lang="scss">
#udesk_container #udesk_btn .udesk-client-btn {
  right: 0 !important;
  top: calc(100vh - 40px) !important;
  margin: 3px 0 3px 30px !important;
}
#udesk_frame_dialog {
  display: none !important;
}
</style>
